home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / up < prev    next >
Text File  |  1995-03-31  |  4KB  |  95 lines

  1. Article 1265 of comp.sys.handhelds:
  2. From: Jake-S@cup.portal.com (Jake G Schwartz)
  3. Subject: HP48SX UP function for Built in Menus
  4. Date: 3 Mar 90 20:27:30 GMT
  5. Organization: The Portal System (TM)
  6. Lines: 85
  7.  
  8.  
  9.                    HP48 UP Key For Built-In Menus
  10.  
  11.      The folks at HP took a lesson from the 28S and gave us the badly-
  12. needed "UP" function on the HP48 keyboard for moving from a RAM subdirectory
  13. to its parent directory.  However several of the built-in (ROM) menus in the
  14. machine are nested in a tree structure as low as three levels deep.  The
  15. user manual on page 56 advises that one doesn't traverse these like a tree;
  16. one should simply go to the new one.  In many cases, this requires more than
  17. a keystroke or two.
  18.      The HP48 has a function RCLMENU which returns a value containing the
  19. number (in its integer part) and page (in its 2-digit decimal fractional
  20. part) of the currently displayed menu.  (See page 697 of the user manual
  21. for the complete list of numbered menus.)  We may utilize RCLMENU in con-
  22. junction with UPDIR (the programmable version of the keyboard UP function)
  23. to traverse the built-in menu trees as well as the RAM subdirectories.
  24.      Here is a short routine called UP which allows automatic movement from
  25. a RAM or ROM menu to its parent (if one exists), and which is based on a 59-
  26. element list called PARENT.  Element n of the list has the value of the 
  27. menu number and page of the parent corresponding to menu n for menus 1 
  28. through 59.  (Since menu 0 is the LAST menu, it is not considered to be the
  29. current menu for purposes here.)  Note that if the parent menu key leading
  30. to the currently displayed menu is on a page beyond page 1 (such as in the
  31. UNITS submenus which have parents in pages 1 through 3 of the main UNITS
  32. menu), this routine will return to the correct originating page of the
  33. parent.  For menus which do not have a parent, the list element is 0, 
  34. allowing the UP routine to perform a LAST MENU function rather than alter-
  35. nately being a "do nothing" condition.
  36.      IF UP is assigned to the UP keyboard key, its use becomes transparent
  37. when the HP48 is in USER mode.  In the first weeks of calculator use, ROM
  38. menu tree traversal is helpful in order to get a feel for where the 
  39. literally hundreds of functions reside in the machine.
  40.  
  41.                                            Jake Schwartz
  42.                                            135 Saxby Terrace
  43.                                            Cherry Hill, NJ 08003
  44.  
  45.                                            609-751-1310 home
  46.                                            609-866-6268 work
  47.  
  48.  
  49. PARENT   (59-element list)  443 bytes    #755Dh checksum
  50.  
  51. { 0     0     0     3     3     3     3     3     3     0
  52.   10    10    10    10    10    10    0     0     18    0
  53.   0     0     0     0     24    24    24    0     0     29
  54.   0     31    32    0     0     35    35    37    35    0
  55.   40.04 0     42    42    42    42    42    42    42.02 42.02
  56.   40.02 40.02 42.02 42.02 42.03 42.03 42.03 42.03 42 }
  57.  
  58.  
  59. UP   78.5 bytes    #3F92h checksum
  60.  
  61. << PARENT RCLMENU IP DUP
  62.    IF 2 ==
  63.    THEN DROP DROP UPDIR
  64.    ELSE DUP SUB OBJ-> DROP MENU
  65.    END
  66. >>
  67.  
  68.  
  69. Rules:
  70. -----
  71.  
  72. If the current        The action of 
  73. menu is:              UP is:
  74. -----------------------------------
  75. Menu with no          LAST MENU
  76. parent
  77.  
  78. Menu with a           Moves to parent
  79. parent                menu, page of
  80.                       parent key
  81.  
  82. RAM directory         UPDIR
  83.  
  84. Custom Menu           LAST MENU
  85.  
  86. Note: if the current menu is one of the manually-entered unnumbered ones,
  87. RCLMENU returns the value of the last numbered menu that was active.  Thus,
  88. UP will move to the parent of THAT menu.
  89.  
  90.  
  91.  
  92. Jake Schwartz
  93.  
  94.  
  95.